import mountNativeElement from './mountNativeElement'
import isFunction from './isFunction'
import mountComponent from './mountComponent'

export default function mountElement(virtualDOM, container, oldDOM) {
  // 判断是组件还是普通元素
  if(isFunction(virtualDOM)) {
    // 组件
    mountComponent(virtualDOM, container, oldDOM)
  } else {
    // 普通元素
    mountNativeElement(virtualDOM, container, oldDOM)
  }
}